package magasin;

public class Article {

	private String code;
	private String description;
	private double prix;
	private int quantite;
	
	public Article(String code, String description, double prix, int quantite)
	{
		this.code = code;
		this.description = description;
		this.prix = prix;
		this.quantite = quantite;
	}
	
	public String getCode()
	{
		return this.code;
	}
	
	public String getDescription()
	{
		return this.description;
	}
	
	public double getPrix()
	{
		return this.prix;
	}
	
	public int getQuantite()
	{
		return this.quantite;
	}
	
	public boolean Save()
	{
		return true;
	}
	
	public void Deduire(int Quantite)
	{
		if(Quantite > 0)
		{
			if(Quantite < this.quantite)
				this.quantite -= Quantite;
			else
				this.quantite = 1;
		}
	}
	
	public void Ajouter(int Quantite)
	{
		if(Quantite > 0)
			this.quantite += Quantite;
	}
}
